******************************************************
***** Tables for District-Level Splitting Analysis
******************************************************

use "replication_district.dta"

xtset kode year

********* Manuscript Table 1
eststo:reg split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all t1 t2 t3,r cluster(kode)
eststo:logit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all t1 t2 t3,r cluster(kode)
eststo:xtlogit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all t1 t2 t3,re
eststo:xtreg split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all t1 t2 t3,fe cluster(kode)
esttab using split_main.tex,se scalars(ll aic) label title(Determinants of District Splits, District-Level) mtitles("OLS" "Logit" "RE-Logit" "FE-OLS") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) replace
eststo clear


****** Appendix Table 1
estpost summarize split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all
esttab using summary_split.tex, cells("mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") noobs nonumber label title("Summary statistics") replace
eststo clear

****** Appendix Table 2
eststo:reg split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini relfractd rev_total_pc rev_natural_pc elected_leader_l partyshare ethfractd partyshare_elf t1 t2 t3,r cluster(kode)
eststo:logit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini relfractd rev_total_pc rev_natural_pc elected_leader_l partyshare ethfractd partyshare_elf t1 t2 t3,r cluster(kode)
eststo:xtlogit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini relfractd rev_total_pc rev_natural_pc elected_leader_l partyshare ethfractd partyshare_elf t1 t2 t3,re
esttab using split_int.tex,se scalars(ll aic) label title(Determinants of District Splits, District-Level) mtitles("OLS" "Logit" "RE-Logit" "FE-OLS") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) replace
eststo clear


****** Appendix Table 3
estsimp reg split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini relfractd rev_total_pc rev_natural_pc elected_leader_l partyshare ethfractd partyshare_elf t1 t2 t3,r cluster(kode)

setx lgdppc mean poverty_pc mean AssocNumbPC mean density mean density2 mean density3 mean services_provision mean gini mean relfractd mean rev_total_pc mean rev_natural_pc mean elected_leader_l 0 partyshare .33512 ethfractd 0.08 partyshare_elf 0.0268096 t1 3 t2 9 t3 27
simqi, fd(ev) changex(ethfractd 0.08 0.70 partyshare_elf 0.02844445 0.234584)

setx lgdppc mean poverty_pc mean AssocNumbPC mean density mean density2 mean density3 mean services_provision mean gini mean relfractd mean rev_total_pc mean rev_natural_pc mean elected_leader_l 0 partyshare .5317 ethfractd 0.08 partyshare_elf 0.042536 t1 3 t2 9 t3 27
simqi, fd(ev) changex(ethfractd 0.08 0.70 partyshare_elf 0.04444445 0.37219)


****** Appendix Table 4
eststo:logit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all pkb_share_all t1 t2 t3,r cluster(kode)
eststo:logit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all ppp_share_all t1 t2 t3,r cluster(kode)
eststo:logit split lgdppc poverty_pc AssocNumbPC density density2 density3 services_provision gini ethfractd relfractd rev_total_pc rev_natural_pc elected_leader_l golkar_share_all pdip_share_all enp_all t1 t2 t3,r cluster(kode)
esttab using split_main_pkb.tex,se scalars(ll aic) label title(Determinants of District Splits, District-Level) mtitles("Logit" "Logit" "Logit") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) replace
eststo clear



******************************************************
***** Tables for Kecamatan-Level Splitting Analysis
******************************************************

use "replication_kec.dta"

xtset kabid03

eststo:reg splitter Ethnic_Diff TransMigration javanese_off_java golkar1 pdip1 povrateksvil natres DistDistrictCap LightStreet Slum PartyOffice MassFight AssocNumbPC AgriIndustry ManufacturingIndustry SchoolPC,r cluster(kabid03)
eststo:logit splitter Ethnic_Diff TransMigration javanese_off_java golkar1 pdip1 povrateksvil natres DistDistrictCap LightStreet Slum PartyOffice MassFight AssocNumbPC AgriIndustry ManufacturingIndustry SchoolPC,r cluster(kabid03)
esttab using subdistricts_splitter.tex,se scalars(ll aic) label title(Determinants of District Splits, Sub-District-Level) mtitles("OLS" "Logit") star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
eststo clear


******************************************************
***** Tables for Violence
******************************************************
use "replication_violence.dta"

****** Appendix Table 7
eststo:nbreg viol_total viol_total_lag lpop lgdppc rev_total_pc rev_natural_pc density poverty_pc gini elected_leader_l AssocNumbPC_const elf_composite new_district2,r cluster(kode_neil)
eststo:nbreg viol_resource viol_resource_lag lpop lgdppc rev_total_pc rev_natural_pc density poverty_pc gini elected_leader_l AssocNumbPC_const elf_composite new_district2,r cluster(kode_neil)
eststo:nbreg viol_governance viol_governance_lag lpop lgdppc rev_total_pc rev_natural_pc density poverty_pc gini elected_leader_l AssocNumbPC_const elf_composite new_district2,r cluster(kode_neil)
eststo:nbreg viol_election viol_election_lag lpop lgdppc rev_total_pc rev_natural_pc density poverty_pc gini elected_leader_l AssocNumbPC_const elf_composite new_district2,r cluster(kode_neil)
eststo:nbreg viol_identity viol_identity_lag lpop lgdppc rev_total_pc rev_natural_pc density poverty_pc gini elected_leader_l AssocNumbPC_const elf_composite new_district2,r cluster(kode_neil)
esttab using violence2_new.tex,se scalars(ll aic) label title(The Effect of District Splits on Local Violence) mtitles("Total" "Resource" "Governance" "Election" "Identity") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) replace

